package com.example.everying.task;

import com.example.everying.service.user.ActivityPointsConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @program: everything
 * @description: 积分过期清理定时任务
 * @author: zw
 * @create: 2025-08-11 16:20
 **/
@Component
public class PointExpireTask {
    @Autowired
    private ActivityPointsConfigService pointsConfigService;

    /**
     * 每天凌晨2点执行积分清理
     */
    @Scheduled(cron = "0 0 2 * * ?")
    public void cleanExpiredPoints() {
        pointsConfigService.cleanExpiredPoints();
    }
}
